<?php
/**
*
* @package ppkBB3cker
* @version $Id: ucp_add1.php 1.000 2009-05-11 14:36:00 PPK $
* @copyright (c) 2009 PPK
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
	exit;
}

if(!function_exists('display_forums'))
{
	include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
}

$torrent_info_curr='';

$torrent_info_curr_explain=$assign_vars=$torrent_info=$sort_opt=$postrow_headers=$postrow_header=array();
$i3=0;
$user_id=$user->data['user_id'];
$is_admod=$auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_') ? 1 : 0;

$torrent_opt=request_var('opt', '');
/*$opt_sort=request_var('opts', '');
$opt_param=request_var('optp', '');
$opt_sort=='ASC' ? '' : $opt_sort='DESC';*/

$ucp_url=append_sid("ucp.$phpEx", "i=$id&amp;mode=torrents");

$torrents_info=array('torrent', 'finished', 'seed', 'leech', 'tothanks', 'fromthanks', 'history', 'leave', 'fromseedreq');
foreach($torrents_info as $iv)
{
	if($iv=='fromseedreq' && !$config['ppkbb_srenable'])
	{
		$torrent_opt='' ;
		continue;
	}
	$ajax_mua_url=str_replace('&amp;', '&', append_sid("{$phpbb_root_path}tracker/ajax.{$phpEx}?opt={$iv}&amp;page=mua&amp;mua=ucp"));
	$torrent_info[$iv]='<a class="torrent_stat" rel="'.$ajax_mua_url.'" href="javascript:;">'.$user->lang['TORRENT_INFO_HEADER_'.strtoupper($iv)].'</a>';
	//$torrent_info[$iv]='<a href="'.$ucp_url.($torrent_opt!=$iv ? '&amp;opt='.$iv.'#opt' : '').'">'.$user->lang['TORRENT_INFO_HEADER_'.strtoupper($iv)].'</a>';
}

/*$mua_add1inc=$phpbb_root_path.'tracker/include/';
$mua='ucp';

switch($torrent_opt)
{
	case 'leave':
		include($mua_add1inc.'mua_add1_leave.'.$phpEx);
		break;

	case 'history':
		include($mua_add1inc.'mua_add1_history.'.$phpEx);
		break;

	case 'finished':
		include($mua_add1inc.'mua_add1_finished.'.$phpEx);
		break;

	case 'seed':
		include($mua_add1inc.'mua_add1_seed.'.$phpEx);
		break;

	case 'leech':
		include($mua_add1inc.'mua_add1_leech.'.$phpEx);
		break;

	case 'tothanks':
		include($mua_add1inc.'mua_add1_tothanks.'.$phpEx);
		break;

	case 'fromthanks':
		include($mua_add1inc.'mua_add1_fromthanks.'.$phpEx);
		break;

	case 'torrent':
		include($mua_add1inc.'mua_add1_torrent.'.$phpEx);
		break;

	case 'fromseedreq':
		include($mua_add1inc.'mua_add1_fromseedreq.'.$phpEx);
		break;

	default:
		$torrent_opt='';
		break;
}
*/
//torrent_info_curr_explain[$torrent_opt]=$user->lang['TORRENT_INFO_HEADER_'.strtoupper($torrent_opt)];
$template->assign_vars(array(
/*
	'S_HAS_TORRENT_EXPLAIN'	=> $torrent_info_curr ? true : false,
	'S_HAS_TORRENT_EXPLAIN_TORRENT'	=> @$torrent_info_curr_explain['torrent'] ? true : false,
	'S_HAS_TORRENT_EXPLAIN_FINISHED'	=> @$torrent_info_curr_explain['finished'] ? true : false,
	'S_HAS_TORRENT_EXPLAIN_FROMTHANKS'=> @$torrent_info_curr_explain['fromthanks'] ? true : false,
	'S_HAS_TORRENT_EXPLAIN_TOTHANKS'	=> @$torrent_info_curr_explain['tothanks'] ? true : false,
	'S_HAS_TORRENT_EXPLAIN_HISTORY'	=> @$torrent_info_curr_explain['history'] ? true : false,
	'S_HAS_TORRENT_EXPLAIN_LEAVE'	=> @$torrent_info_curr_explain['leave'] ? true : false,
	'S_HAS_TORRENT_EXPLAIN_SEED'	=> @$torrent_info_curr_explain['seed'] ? true : false,
	'S_HAS_TORRENT_EXPLAIN_LEECH'	=> @$torrent_info_curr_explain['leech'] ? true : false,
	'S_HAS_TORRENT_EXPLAIN_FROMSEEDREQ'=> @$torrent_info_curr_explain['fromseedreq'] ? true : false,
*/
	//'S_HAS_TORRENT_EXPLAIN_TOSEEDREQ'	=> @$torrent_info_curr_explain['toseedreq'] ? true : false,
	'TORRENT_INFO_OPT'=>implode(' : ', $torrent_info),
));

/*
if($assign_vars)
{
	foreach($assign_vars as $k2 => $v2)
	{
		$template->assign_block_vars($torrent_info_curr.'_option', $v2);
	}
}

if($postrow_headers)
{
	foreach($postrow_headers as $k2 => $v2)
	{
		$template->assign_block_vars('headers', array('VALUE' => $v2));
	}
}

if(sizeof($postrow_header))
{
	$template->assign_var('S_TORRENT_FOOTER', implode(' : ', $postrow_header));

}*/
?>
